Skip to content

Conversation

@MiniCodeMonkey
Copy link
Owner

Summary

Adds git worktree support so each PRD runs in its own isolated directory and branch. This eliminates file conflicts when running multiple PRDs in parallel, and enables automatic push + PR creation on completion.

Changes

  • Config system (internal/config/): New .chief/config.yaml (YAML) for project-level settings — worktree setup command, auto-push, and auto-PR creation
  • Git worktree primitives (internal/git/worktree.go): Create, remove, list, prune, and merge worktrees. Branches always start from the default branch (main/master)
  • Git push + PR (internal/git/push.go): Push branches to origin, create PRs via gh CLI, with eager gh validation
  • Loop working directory (internal/loop/loop.go): Loop accepts a workDir so Claude runs in the worktree instead of the PRD directory
  • Manager worktree tracking (internal/loop/manager.go): LoopInstance tracks worktree path and branch; post-completion hooks for auto-push and PR creation
  • First-time setup (internal/tui/first_time_setup.go): Extended onboarding with post-completion config (push/PR toggles with gh validation) and worktree setup command detection (auto-detect via Claude or manual entry)
  • Enhanced branch warning (internal/tui/branch_warning.go): Start dialog offers worktree creation with full path transparency, context-aware options based on protected branch and parallel PRD detection
  • Worktree setup spinner (internal/tui/worktree_spinner.go): Animated progress display for branch creation, worktree setup, and dependency installation
  • Tab bar (internal/tui/tabbar.go): Shows [branch-name] per tab
  • Dashboard header (internal/tui/dashboard.go): Shows branch and worktree directory info
  • Picker (internal/tui/picker.go): Displays worktree path and branch per PRD; m to merge, c to clean completed PRDs
  • Completion screen (internal/tui/completion.go): Shows auto-action progress (push, PR creation) with inline error handling
  • Settings TUI (internal/tui/settings.go): Modal overlay via , keybinding for editing all config values with immediate save
  • Orphaned worktree cleanup (internal/tui/app.go): Startup detection and pruning of stale worktrees
  • Documentation: Updated all docs (quick-start, configuration, CLI reference, concepts, troubleshooting, FAQ) and added ADR-0007 for the worktree isolation decision
  • Spec document: WORKTREES_SPEC.md with full design, UX flows, TUI mockups, and implementation details

42 files changed, ~8,000 lines added across implementation and tests.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant